package controllers

import (
	"blogs/models"
	"blogs/utils"
	beego "github.com/beego/beego/v2/server/web"
)

// Operations about object
type SettingController struct {
	beego.Controller
}

// @Title Get
// @Description 查询系统设置
// @Success 200 {object} models.Setting
// @router / [get]
func (o *SettingController) GetAll() {
	Setting := []models.Setting{}
	utils.DB.Find(&Setting)
	o.Data["json"] = map[string]interface{}{
		"msg":  "查询成功",
		"data": Setting[0],
		"code": false,
	}
	o.ServeJSON()
}
